<template>
	<view class="container-act">
		<view class="act-top">
			{{$t('活动')}}
		</view>
		<view class="act-view" v-for="(item,index) in actList" :keys="index" @click="gotodetail(item.id,item.title,item.create_at)">
			<p class="act-title">{{item.title}}</p>
			<p class="act-time">{{item.create_at}}</p>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				actList:[
				],	
			}
		},
		onShow() {
			uni.setTabBarItem({// 修改底部导航
				index: 0,
				text: this.$t('home'),
			});
			uni.setTabBarItem({// 修改底部导航
				index: 1,
				text: this.$t('cf'),
			});
			uni.setTabBarItem({// 修改底部导航
				index: 2,
				text: this.$t('hd'),
			});
			uni.setTabBarItem({// 修改底部导航
				index: 3,
				text: this.$t('user'),
			});
		},
		onLoad() {
			this.getindex()
		},
		methods: {
			getindex(){
				this.$http.get(
					'api/hd/index',//接口名
					{},//参数合集
					{},
					false
				).then(res=>{
					this.actList = res.data.data
				},(err)=>{//失败的操作
					uni.showToast({
						icon: 'error',
						title: err.data.message
					});
				})
			},
			gotodetail(id,title,time){
				uni.navigateTo({
					url: '/pages/activity/actDetail?id='+id
				})	
			}
		}
	}
</script>

<style>
	.container-act{
		background-color: #f6f6f6;
	}
	.act-top{
		height:88rpx;
		line-height:88rpx;
		text-align: center;
		font-size:36rpx;
		font-weight:500;
		background-color: #fff;
	}
	.act-view{
		border-radius: 6px;
		width: 96%;
		background: #fff;
		margin: 10px 0 10px 2%;
		border-radius: 5px;
	}
	.act-title{
		padding: 10px 0 10px 10px;
		font-weight: 700;
		font-size:24rpx;
	}
	.act-time{
		padding: 0 0 10px 10px;
		color: #999;
		font-size:24rpx;
	}
</style>
